package com.burgeon.backend.SHOPBACKEND.controller;

import com.burgeon.backend.SHOPBACKEND.service.BackendEvaluateService;
import com.burgeon.backend.stsutil.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

@RestController
@CrossOrigin
@RequestMapping("backend/evaluate")
public class BackendEvaluateController extends BaseController {
    @Autowired
    private BackendEvaluateService backendEvaluateService;


    @RequestMapping("isshow")
    public ResponseResult<Void> isShow(String id, String state, String account) {
        backendEvaluateService.showHidden(id,state,account);
        return new ResponseResult<>(SUCCESS);
    }


    @RequestMapping("find")
    public ResponseResult<HashMap> FindData(String field, String message, String account,Integer start) {
        HashMap data = backendEvaluateService.FindData(field,message,account, start);
        return new ResponseResult<HashMap>(SUCCESS,data);
    }


    @RequestMapping("data")
    public ResponseResult<HashMap> businessCard (String account,Integer start) {
        HashMap data = backendEvaluateService.getData(account, start);
        return new ResponseResult<HashMap>(SUCCESS,data);
    }

}
